<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>后台分类新增</title>
	<script type="text/javascript" src="js/jquery-2.1.1.js"></script>
	<link rel="stylesheet" href="css/reset.css" />
	<link rel="stylesheet" href="css/content.css" />
	<script type="text/javascript">
		$(function(){
			$("#sub").click(function(){
    		
    		
    			if($("input[name='typename']").val()==null || $("input[name='typename']").val()==""){
	    			alert("帐户不能为空！");
	    			$("input[name='typename']").focus();
	    			return false;
        		}
				
					$.ajax({
						type:'post',
						url:'${pageContext.request.contextPath}/servlet/inserttypeServlet',
						data:{
							typename:$("input[name='typename']").val()
						},
						success:function(response,status,xhr){
							//alert(response);
							alert("添加成功！！！");
							}
							
						
					});
			});
		});
	</script>
</head>
<body marginwidth="0" marginheight="0">
	<div class="container">
		<div class="public-nav">您当前的位置：<a href="">管理首页</a>><a href="">分类管理</a></div>
		<div class="public-content">
			<div class="public-content-header">
				<h3>新增分类</h3>
			</div>
			<div class="public-content-cont">
			<form action="" method="post" style="margin:0 auto;width:50%">
				<div class="form-group">
					<label for="">分类名称:</label>
					<input class="form-input-txt" type="text" name="typename"/>
				</div>
				<div class="form-group" style="margin-left:100px;">
					<input type="submit" class="sub-btn" value="提  交" id="sub"/>
					<input type="reset" class="sub-btn" value="重  置" />
				</div>
			</form>
			</div>
		</div>
	</div>
</body>
</html>